import React, { Component } from 'react';
import "./ChildPage.css";
import { Icon } from 'antd';
class ChildPage extends Component {
    getPageState() {
        let classNames = ["ChildPage"];
        if(this.props.show){
            classNames.push("active");
        }
        return classNames.join(" ");
    }
    render() {
        return (
            <div className={this.getPageState()}>
                <div className="ChildPage-title">
                    <div className="return-btn" onClick={() => this.props.onHide()}><Icon type="left"/>返回</div>
                </div>
                <div className="content">
                    {this.props.children}
                </div>
            </div>
        )
    }
}
export default ChildPage;